package com.thon.entity.system;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.thon.entity.util.IdEntity;

/**
 * @author manpiaoyi
 * @mail manpiaoyi@126.com
 * @date 2014-10-19
 * @description
 */
@Entity
@Table(name = "roles")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Roles extends IdEntity {
	
	private static final long serialVersionUID = -2882541081318874188L;
	private String roleCode;
	private String roleName;
	private SystemDicData roleType;
	private Integer sort;
	private String description;
	
	public String getRoleCode() {
		return roleCode;
	}
	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}
	public String getRoleName() {
		return roleName;
	}
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	
	@ManyToOne(cascade = CascadeType.MERGE)	
	@JoinColumn(name="roleType",nullable = false)
	@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
	public SystemDicData getRoleType() {
		return roleType;
	}
	public void setRoleType(SystemDicData roleType) {
		this.roleType = roleType;
	}
	public Integer getSort() {
		return sort;
	}
	public void setSort(Integer sort) {
		this.sort = sort;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}

	
	
}
